﻿<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<meta charset="utf-8">
	<title>登录</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
	<meta name="description" content="">
	<meta name="author" content="">
	<!-- STYLESHEETS --><!--[if lt IE 9]><script src="js/flot/excanvas.min.js"></script><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script><![endif]-->
	<link rel="stylesheet" type="text/css" href="css/cloud-admin.css" >
	
	<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet">
	<!-- DATE RANGE PICKER -->
	<link rel="stylesheet" type="text/css" href="js/bootstrap-daterangepicker/daterangepicker-bs3.css" />
	<!-- UNIFORM -->
	<link rel="stylesheet" type="text/css" href="js/uniform/css/uniform.default.min.css" />
	<!-- ANIMATE -->
	<link rel="stylesheet" type="text/css" href="css/animatecss/animate.min.css" />
	<!--jquery -->
	<script type="text/javascript" src="js/jquery/jquery-2.0.3.min.js" ></script>
	
	<!-- select2 -->
	<script type="text/javascript" src="js/select2/js/select2.min.js"></script>
	<link rel="stylesheet" type="text/css" href="js/select2/css/select2.min.css" />
	
	<script type="text/javascript" src="js/share.js" ></script>
	
	<script type="text/javascript">
		$(function(){

		    $('#userList').select2({  
		        placeholder: "请选择业务流程",  
		        width:'100%'  
		    });  
		    
			$.ajax({ 
				url: basePath() + 'index/finduser.do',
				dataType: "json",
		        contentType: "application/json",
				success: function(data){	
			    	if(data.result == 1){

// 						alert(JSON.stringify(data));

						var dataStr = data.datas;	
						
						var selectID = 'userList';
						
						// 先清空控件数据
						$('#' + selectID).empty(); 

// 						var option = $("<option>").val("").text(""); 
						$('#' + selectID).append(option); 
						
						for (var i = 0; i < dataStr.length; i++) {
							var value = dataStr[i].userid;
							var text = dataStr[i].username;
							
							var option = $("<option>").val(value).text(text); 
							$('#' + selectID).append(option); 
						}	
			    	}				

		      	}
			});
			
			
			$('#userLogin').click(function(){
// 				window.location = "index.html";
				$.ajax({ 
					url: basePath() + 'index/login.do',
					data: {"userid": $('#userList').val()},
					dataType: "json",
			        contentType: "application/json",
					success: function(data){	
// 						alert(data.result);
				    	if(data.result == 1){
				    		window.location = "index.html";
				    	}				

			      	}
				});
			})
		})
	
	</script>
</head>
<body class="login">	
	<!-- PAGE -->
	<section id="page">
			<!-- LOGIN -->
			<section id="login" class="visible">
				<div class="container">
					<div class="row">
						<div class="col-md-4 col-md-offset-4">
							<div class="login-box-plain">
								<h2 class="bigintro">电子政务协同审批平台</h2>
								<div class="divide-40"></div>
								<form role="form">
								  <div class="form-group">
									<label for="exampleInputEmail1">账号</label>
<!-- 									<i class="fa fa-user"></i> -->
<!-- 									<input type="email" class="form-control" id="exampleInputEmail1" > -->
<!-- 										<select id="userList" class="form-control" > -->
<!-- 											<option value="apply1">   申请1</option> -->
<!-- 											<option value="apply2">申请2</option> -->
<!-- 											<option value="accept1">受理1</option> -->
<!-- 											<option value="accept2">受理2</option> -->
<!-- 											<option value="approval1">审批1</option> -->
<!-- 											<option value="approval1">审批1</option> -->
<!-- 											<option value="Archiving1">归档1</option> -->
<!-- 										</select>										 -->

									
					                <select class="combox" id="userList" name="userList">    
					                </select>
								  </div>
								  <!-- <div class="form-group"> 
									<label for="exampleInputPassword1">密码</label>
									<input type="password" class="form-control" id="exampleInputPassword1" >
								  </div> -->
								  <div class="form-actions">
									<button type="button" class="btn btn-danger" id="userLogin">登录</button>
								  </div>
								</form>
							</div>
						</div>
					</div>
				</div>
			</section>
			<!--/LOGIN -->
	</section>
	<!--/PAGE -->
	<!-- JAVASCRIPTS -->
	<!-- Placed at the end of the document so the pages load faster -->
	<!-- JQUERY UI-->
	<script src="js/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.min.js"></script>
	<!-- BOOTSTRAP -->
	<script src="bootstrap-dist/js/bootstrap.min.js"></script>
	
	
	<!-- UNIFORM -->
	<script type="text/javascript" src="js/uniform/jquery.uniform.min.js"></script>
	<!-- CUSTOM SCRIPT -->
	<!-- /JAVASCRIPTS -->
</body>
</html>